package at.evonfc.bl;

import android.app.Activity;
import android.content.Intent;
import at.evonfc.data.Cart;
import at.evonfc.view.CartActivity;
import at.evonfc.view.MainActivity;

public class MenuUtils {

	private static MenuUtils theInstance = null;
	
	private MenuUtils () {
		
	}
	
	public static MenuUtils getInstance() {
		if(theInstance == null) {
			theInstance = new MenuUtils();
		}
		return theInstance;
	}
	
	public void onLogout(Activity activity) {
		Cart.clear();
		MainActivity.user = null;
		MainActivity.currDevice = null;
		MainActivity.active_activity = MainActivity.ACTIVITY_NAME;
		Intent intent = new Intent(activity, MainActivity.class);
		activity.startActivity(intent);
	}
	
	public void onCartClick(Activity activity) {
		//open cart class
		Intent intent = new Intent(activity, CartActivity.class);
		activity.startActivity(intent);
	}
}
